package com.sangeng.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 文章表(Article)实体类
 *
 * @author mg
 * @since 2022-04-29 08:16:50
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sg_article")
@JsonIgnoreProperties(value = "hibernateLazyInitializer")
public class Article implements Serializable{
    private static final long serialVersionUID= -75212426150610336L;
    @TableId
    private Long id;
    /** 标题*/
    private String title;
    /** 文章内容*/
    private String content;
    /** 文章摘要*/
    private String summary;
    /** 所属分类id*/
    private Long categoryId;
    @TableField(exist = false)
    private String categoryName;
    /** 缩略图*/
    private String thumbnail;
    /** 是否置顶（0否，1是）*/
    private String isTop;
    /** 状态（0已发布，1草稿）*/
    private String status;
    /** 访问量*/
    private Long viewCount;
    /** 是否允许评论 1是，0否*/
    private String isComment;
    
    private Long createBy;
    
    private Date createTime;
    
    private Long updateBy;
    
    private Date updateTime;
    /** 删除标志（0代表未删除，1代表已删除）*/
    private Integer delFlag;

    public Article(Long id, long viewCount) {
        this.id = id;
        this.viewCount = viewCount;
    }
}

